const { createFail } = require('../utils/')

function checkUserLogin(req, res, next) {
  const { username, password } = req.body
  if (!username || !password) {
    res.json(createFail('用户名或密码不能为空'))
  } else {
    next()
  }
}

module.exports = checkUserLogin
